package com.smartleanx.module.hrm.service.examine.examinSon;

import java.util.*;
import javax.validation.*;

import com.alibaba.fastjson2.JSONObject;
import com.smartleanx.module.hrm.controller.admin.examine.examinSon.vo.ExamineSaveReqVO;
import com.smartleanx.module.hrm.controller.admin.examine.examinSon.vo.*;
import com.smartleanx.module.hrm.dal.dataobject.examine.examinSon.ExamineDO;
import com.smartleanx.framework.common.pojo.PageResult;
import com.smartleanx.module.hrm.dal.dataobject.examine.examineRecord.ExamineRecordDO;
import com.smartleanx.module.hrm.dal.dataobject.examine.examineRecordRater.ExamineRecordRaterDO;
import com.smartleanx.module.hrm.dal.dataobject.examine.vo.ExamineVo;
import com.smartleanx.module.infra.api.file.dto.FileRefRespDTO;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 考核计划 Service 接口
 *
 * @author 宁无霜
 */
public interface ExamineService {

    /**
     * 创建考核计划
     *
     * @param param 创建信息
     * @return 编号
     */
    Integer createExamine(@Valid JSONObject param);

    /**
     * 更新考核计划
     *
     * @param updateReqVO 更新信息
     */
    Integer updateExamine(JSONObject param);

    void deletedExamineRecordAll(Integer id, Integer examineId);

    /**
     * 删除考核计划
     *
     * @param id 编号
     */
    void deleteExamine(Integer id);


    /**
     * 获得考核计划
     *
     * @param id 编号
     * @return 考核计划
     */
    ExamineDO getExamine(Integer id);

    /**
     * 获得考核计划分页
     *
     * @param pageReqVO 分页查询
     * @return 考核计划分页
     */
    PageResult<ExamineDO> getExaminePage(ExaminePageReqVO pageReqVO);

    JSONObject selectExamineVoList(Integer id);

    /**
     * 开启考核计划
     */
    Integer startExamine(Integer id);

    /**
     * 被考核员工计划列表
     */
    JSONObject selectExamineEmployeeList(Integer examineId);

    /**
     * 被考核员工计划列表
     */
    ExamineDO selectExamine(Integer examineId);

    /**
     * 考核计划 1进行中 2已完成 3已归档
     */

    PageResult<ExamineDO> getExamineStartedList(Integer type, Integer pageNum, Integer pageSize, String examinePlanName, Integer examineCycleTypeId);

    /**
     * 开始评分
     */
    Integer startProgress(Integer examineId);


    /**
     * 考核计划列表员工端
     */
    PageResult<ExamineRecordRaterDO> selectExamineBYEmployeeId(Integer type, Integer pageNum, Integer pageSize);


    PageResult<ExamineRecordDO> selectExamineBYReviewEmployeeId(Integer type, Integer pageNum, Integer pageSize);


    /**
     * 评分
     */
    JSONObject progress(Integer recordId, Integer scorerOrder);


    /**
     * 开始评分
     */
    Integer startProgress(JSONObject param);


    /**
     * 计算分数
     */
    JSONObject checkProgress(List<JSONObject> param);

    /**
     * 考核计划详情员工端
     */
    JSONObject selectExamineInfoByEmployee(JSONObject param);


    /**
     * 考核计划详情管理端
     */
    JSONObject selectExamineInfoById(JSONObject param);

    /**
     * 考核确认详情员工端
     */
    JSONObject selectLaunchResultExamineInfoById(Integer examineId);

    List<JSONObject> selectLaunchResultList();


    /**
     * 开始审核展示的列表
     */
    List<ExamineRecordDO> selectStartReviewList(Integer examineId, Integer type);

    /**
     * 开始审核
     */
    Integer startReview(Integer examineId);


    /**
     * 考核进度展示列表
     */
    List<ExamineRecordDO> selectExamineScheduleList(Integer examineId, Integer gradeId, String employeeName, Integer type);


    /**
     * 考核进度展示列表
     */
    List<ExamineRecordDO> selectExamineScheduleEmployeeList(Integer examineId, Integer gradeId, String employeeName);

    /**
     * 员工端审核
     */
    Integer review(JSONObject param);

    /**
     * 审核可驳回评分人节点
     */
    List<JSONObject> nodeList(Integer recordId);


    /**
     * 员工端确认
     */
    Integer confirm(JSONObject param);



    /**
     * 员工端确认
     */
    Integer adminConfirm(JSONObject param);


    /**
     * 管理员帮助确认确认
     */
    Integer confirmByAdmin(JSONObject param);
    /**
     * 发送结果展示列
     */
    List<ExamineRecordDO> launchResultList(Integer examineId);


    /**
     * 发送结果
     */
    Integer launchResult(JSONObject param);


    /**
     * 撤回结果
     */
    Integer withdrawResult(JSONObject param);


    /**
     * 结果确认详情详情
     */
    JSONObject selectLaunchResultExamineInfoByIdWeb(Integer examineId);

    /**
     * 绩效归档
     */
    Integer examineFile(Integer examineId);


    /**
     * 绩效档案列表
     */
    PageResult<ExamineRecordDO> selectExamineFileList(Integer pageNum, Integer pageSize,
                                                      String employeeName,
                                                      String employeeNo,
                                                      Integer deptId,
                                                      Integer postId,
                                                      Integer employeeState,
                                                      Integer sourceUnit,
                                                      Integer sources);


    List<ExamineRecordDO> selectExamineFileExcel();


    PageResult<ExamineRecordDO> selectEmployeeExamineFileList(Integer pageNum, Integer pageSize);

    List<ExamineRecordDO> selectEmployeeExamineExcelFileList();

    List<ExamineRecordDO> selectExamineFileInfoList(Integer employeeId, String examinePlanName);

    List<ExamineRecordDO> selectExamineFileInfoExcelList(Integer employeeId, String examinePlanName);


    ExamineRecordDO selectEmployeeExamineFileInfoList(Integer examineRecordId);


    JSONObject selectFileTitle(@RequestParam("employeeId") Integer employeeId);


    JSONObject selectjdTitle(@RequestParam("employeeId") Integer examineId);

    /**
     * @param
     * @return
     */
    List<JSONObject> selectExamineFileListInfo(Integer examineId);


    Integer insertIsLowFile(Integer examineRecordId, String file);

    List<FileRefRespDTO> selectIsLowFile(Integer examineRecordId);


    JSONObject selectDealtWithNum();


    Integer progressMessage(Integer type, Integer recordId);


}